function deepClone(obj){
    if(obj === undefined){
        return undefined;
    }
    if(obj === null){
        return null;
    }
    if(typeof obj === 'number' || typeof obj === 'string'){
        return JSON.parse(JSON.stringify(obj));
    }
    let objClone =  Array.isArray(obj) ? [] : {};
    if (obj && typeof obj === 'object') {
        for(let key in obj){
            if (obj[key] && typeof obj[key] === 'object'){
                objClone[key] = deepClone(obj[key]);
            }else{
                objClone[key] = obj[key]
            }
        }
    }
    return objClone;
}

module.exports = {
    deepClone
};
